package com.cskaoyan.service;
/*
 * @author 魏骏杰
 */

import com.cskaoyan.bean.dashboard.DashBoard;
import com.cskaoyan.mapper.DashBoardMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class DashBoardServiceImpl implements DashBoardService {
    @Autowired
    DashBoardMapper dashBoardMapper;


    @Override
    public DashBoard countTablesForDashboard() {
        DashBoard dashboard = new DashBoard();
        dashboard.setGoodsTotal(dashBoardMapper.countTableGoods());
        dashboard.setOrderTotal(dashBoardMapper.countTableOrder());
        dashboard.setProductTotal(dashBoardMapper.countTableProduct());
        dashboard.setUserTotal(dashBoardMapper.countTableUser());
        return dashboard;
    }
}
